feat(parser): resolve repository-local Python star imports#638
Merged
Conversation
Port the viable behavior from PR #328 (commit 7717968) onto the current parser. Expand direct, __all__, relative, transitive, and notebook imports without reading outside the configured repository; share a bounded, fingerprinted, thread-safe cache across worker parser instances and fail soft on imported-module errors. Co-authored-by: Gideon Zenz <91069374+gzenz@users.noreply.github.com>
code-review-graph reviewOverall risk: 0.65 (MEDIUM) — 27 changed function(s)/class(es), 0 affected flow(s), 19 test gap(s) Risk-scored changes
Test gaps
Token savings: this graph-backed report used ~77,613 fewer tokens (~94%) than reading every changed file in full (estimated, chars/4 approximation). Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
from X import *in import_map #328 (source commit7717968) onto currentmain, without carrying the stale stacked branch__all__, and notebook Python star imports to repository-local symbolsThe implementation commit preserves Gideon Zenz's authorship with a
Co-authored-bytrailer.Safety and compatibility
__all__is accepted only when it is a literal list/tuple of stringsTests
Added red/green regressions covering:
__all__Verification on the final rebase:
pytest -q: 1515 passed, 1 skipped, 2 xpassedruff check code_review_graph/: passedruff check code_review_graph/parser.py tests/test_python_star_imports.py: passedmypy code_review_graph/ --ignore-missing-imports --no-strict-optional: passedSource: #328